<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>中玩棋牌管理后台</title>
    <!-- Tell the browser to be responsive to screen width -->
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
    <!-- Bootstrap 3.3.6 -->
    <link rel="stylesheet" href="/backend/bootstrap/css/bootstrap.min.css">
    <!-- Font Awesome -->
    <link rel="stylesheet" href="/backend/plugins/font-awesome/css/font-awesome.min.css">
    <!-- Ionicons -->
    <link rel="stylesheet" href="/backend/plugins/ionicons/css/ionicons.min.css">
    <!-- Theme style -->
    <link rel="stylesheet" href="/backend/dist/css/AdminLTE.min.css">
    <link rel="stylesheet" href="/backend/dist/css/skins/_all-skins.min.css">
</head>
<body class="hold-transition skin-blue sidebar-mini">
<header class="main-header">
    <!-- Logo -->
    <a href="index2.html" class="logo">
        <!-- mini logo for sidebar mini 50x50 pixels -->
        <span class="logo-mini"><b>中玩棋牌--管理后台</b></span>
        <!-- logo for regular state and mobile devices -->
        <span class="logo-lg"><b>中玩棋牌--管理后台</b></span>
    </a>
    <!-- Header Navbar: style can be found in header.less -->
    <nav class="navbar navbar-static-top">
        <!-- Sidebar toggle button-->
        <a href="#" class="sidebar-toggle" data-toggle="offcanvas" role="button">
            <span class="sr-only">Toggle navigation</span>
        </a>

        <div class="navbar-custom-menu">
            <ul class="nav navbar-nav">
                <li>
                    <a href="{{URL::action('AdminController@logout')}}" title="退出登录">退出&nbsp;&nbsp;<i
                                class="fa fa-sign-out"></i></a>
                </li>
            </ul>
        </div>
    </nav>
</header>

<aside class="main-sidebar">
    <!-- sidebar: style can be found in sidebar.less -->
    <section class="sidebar">
        <!-- Sidebar user panel -->
        <div class="user-panel">
            <div class="pull-left image">
                <img src="/backend/dist/img/user2-160x160.jpg" class="img-circle" alt="User Image">
            </div>
            <div class="pull-left info">
                <p>{{$manager->getRealName()}}</p>
                <a href="javascript:void(0);"><i class="fa fa-circle text-success"></i> {{$manager->getRoleName()}}</a>
            </div>
        </div>

        <!-- sidebar menu: : style can be found in sidebar.less -->
        <ul class="sidebar-menu">
            <li class="header">管理菜单</li>
            @foreach($manager->getModules() as $module)
                @if($module->layer==1)
                    <li class="treeview">
                        <a href="javascript:void(0);">
                            <i class="fa fa-circle-o"></i> <span>{{$module->name}}</span>
                            <span class="pull-right-container"><i class="fa fa-angle-left pull-right"></i></span>
                        </a>
                        <ul class="treeview-menu">
                            @foreach($manager->getModules() as $subItem)
                                @if($subItem->parent_id == $module->manager_module_id)
                                    <li><a href="{{URL::action($subItem->link)}}" target="conframe"
                                           layer="2"></i>{{$subItem->name}}</a></li>
                                @endif
                            @endforeach
                        </ul>
                    </li>
                @endif
            @endforeach
        </ul>
    </section>
    <!-- /.sidebar -->
</aside>
<div class="content-wrapper">
    <iframe id="frame_content" src="{{URL::action('AdminController@innerIndex')}}" name="conframe"
            onload="reinitIframe();" style="width: 100%;" allowtransparency="yes" frameborder="0"
            scrolling="no"></iframe>
</div>
<footer class="main-footer">
    <div class="pull-right hidden-xs">
        <b>Version</b> 2.3.5
    </div>
    <strong>Copyright &copy; 2014-2016 <a href="http://almsaeedstudio.com">Almsaeed Studio</a>.</strong> All rights
    reserved.
</footer>
<!-- jQuery 2.2.3 -->
<script src="/backend/plugins/jQuery/jquery-2.2.3.min.js"></script>
<!-- Bootstrap 3.3.6 -->
<script src="/backend/bootstrap/js/bootstrap.min.js"></script>
<script src="/backend/dist/js/app.min.js"></script>
<script type="text/javascript">
    //Iframe高度自动适应
    function reinitIframe() {
        var iframe = document.getElementById("frame_content");
        try {
            var bHeight = iframe.contentWindow.document.body.scrollHeight;
            var dHeight = iframe.contentWindow.document.documentElement.scrollHeight;
            var height = Math.max(bHeight, dHeight);
            iframe.height = height;

            $('.main-sidebar').css('height', (height + 110) + 'px');
        } catch (ex) {
        }
    }

    setInterval("reinitIframe()", 200);

    $(function () {
        $('[layer="2"]').click(function () {
            $('[layer="2"]').each(function (item, value) {
                $(value).parent().removeClass('active');
            });

            $(this).parent().addClass('active');

        });
    });
</script>
</body>
</html>
